/**
 * Copyright 2020 Inc.
 **/
package com.myz.cloud.stream.rocketmq.consumer;

import com.myz.cloud.stream.rocketmq.consumer.stream.MessageSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * @author maoyz0621 on 2020/7/7
 * @version v1.0
 */
@SpringBootApplication
@Slf4j
public class StreamRocketMqConsumerApplication implements CommandLineRunner {

    public static void main(String[] args) {
        try {
            SpringApplication.run(StreamRocketMqConsumerApplication.class, args);
        } catch (Exception e) {
            log.error("start StreamRocketMqProducerApplication error:", e);
            // throw e;
        }
        log.info("Start StreamRocketMqProducerApplication Success...");
    }

    @Resource
    MessageSender messageSender;


    @Override
    public void run(String... args) throws Exception {
        messageSender.sendMessage("hello");
        messageSender.push("aaaaaaaaaaaaaaaaaaaaaaa");
        messageSender.bind("bind ========================");
        messageSender.bindNoHeader("bind ****************************");
    }
}